package com.fast.common.junit.test;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.apache.commons.codec.digest.DigestUtils;


public class Digest {

	public static void main(String[] args) throws UnsupportedEncodingException {
		String pwd = "132" ;
		String d1 = DigestUtils.md5Hex(pwd) ;
		String d2 = DigestUtils.sha1Hex(pwd) ;
		String d3 = DigestUtils.sha256Hex(pwd) ;
		String d4 = DigestUtils.md5Hex(pwd) ;
		
		System.out.println("d1##"+d1+"##"+d1.length());
		System.out.println("d2##"+d2+"##"+d2.length());
		System.out.println("d3##"+d3+"##"+d3.length());
		System.out.println("d4##"+d4+"##"+d4.length());
		System.out.println(URLEncoder.encode("This string has spaces","UTF-8"));
	}
	
}
